<?php echo $this->doctype() ?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php echo $this->headMeta() ?>
<title>Draftrack</title>

<!-- <LINK REL="SHORTCUT ICON" HREF="<?php echo $this->baseUrl() ?>/favicon.ico" /> -->

<?php echo $this->headLink() ?>

<?php echo $this->YUILoader(); ?>

</head>

<body class="yui-skin-sam">
<div id="dt_page">
  <div id="dt_header">

    <div id="dt_loginDetails">
      <?php echo $this->loginPanel(); ?>
    </div>
    
    <a id="dt_title" href="<?php echo $this->baseURL() ?>">Draftrack</a>
    
	<?php 
		$isModuleSearchEngine = (bool) @Zend_Registry::get('app_config')->module->search_engine; 
		if($isModuleSearchEngine) {
			$placeholder = 'type here to search '.$this->getModule().'...';
			$formURL = '/'.$this->getModule().'/index/search/';
		}
		else {
			$placeholder = 'type here to search...';
			$formURL = '/index/index/search/';
		}
	?>    
    <form action="<?php echo $this->baseURL().$formURL ?>">
    <input type="text" name="q" id="dt_searchBox" placeholder="<?php echo $placeholder ?>" />
    <button type="submit" id="dt_searchButton" >Search</button>
	</form>

	<?php 
	echo $this->Breadcrumbs();
	?>

  
  	<ul id="dt_favApps">
  		<?php $selected=($this->getModule() == 'status')?' class="selected" ':''; ?>
    	<li><a <?php echo $selected ?> href="<?php echo $this->baseURL() ?>/status/">Status</a></li>
    	
    	<?php $selected=($this->getModule() == 'bookmarks')?' class="selected" ':''; ?>
    	<li><a <?php echo $selected ?> href="<?php echo $this->baseURL() ?>/bookmarks/">Bookmarks</a></li>
    	
    	<?php $selected=($this->getModule() == 'todo')?' class="selected" ':''; ?>
    	<li><a <?php echo $selected ?> href="<?php echo $this->baseURL() ?>/todo/">Todo</a></li>  	
    	
    	<?php $selected=($this->getModule() == 'apidesigner')?' class="selected" ':''; ?>
    	<li><a <?php echo $selected ?> href="<?php echo $this->baseURL() ?>/apidesigner/">API Designer</a></li>
  	</ul>
  
  </div>
  
  <div id="dt_mainPanel">
  
  
  <?php
  //we check if we need to display the sidebar
  $sidebarSession = new Zend_Session_Namespace('sidebar');
  $dt_displaySideBar = $sidebarSession->visible;
  ?>
  
  
	  <div id="dt_sidebar" <?php if(!$dt_displaySideBar) echo 'style="display:none;"' ?> >
	  
	    <ul id="dt_apps">
	    
	    
	    
		    <?php $selected=($this->getModule() == 'apidesigner')?' class="selected" ':''; ?>
		    <li<?php echo $selected ?>>
		    	<a href="<?php echo $this->baseURL() ?>/apidesigner/">
		    		<img src="/draftrack/draftrackfe/public/ressources/apidesigner/logo_mini.png" />
		    		<span>API Designer</span>
			    </a>
			    <?php if(($this->getModule() == 'apidesigner')) echo $this->SidebarLinks(); ?>
		    </li>
	    
		    <?php $selected=($this->getModule() == 'status')?' class="selected" ':''; ?>
		    <li<?php echo $selected ?>>
		    	<a href="<?php echo $this->baseURL() ?>/status/">
		    		<img src="/draftrack/draftrackfe/public/ressources/status/logo_mini.png" />
		    		<span>Status</span>
			    </a>
			    <?php if(($this->getModule() == 'status')) echo $this->SidebarLinks(); ?>
		    </li>
		    
		    <?php $selected=($this->getModule() == 'fop')?' class="selected" ':''; ?>
		    <li<?php echo $selected ?>>
		    	<a href="<?php echo $this->baseURL() ?>/fop/">
		    		<img src="/draftrack/draftrackfe/public/ressources/fop/logo_mini.png" />
		    		<span>FOP</span>
			    </a>
			    <?php if(($this->getModule() == 'fop')) echo $this->SidebarLinks(); ?>
		    </li>


		    <?php $selected=($this->getModule() == 'bookmarks')?' class="selected" ':''; ?>
		    <li<?php echo $selected ?>>
		    	<a href="<?php echo $this->baseURL() ?>/bookmarks/">
		    		<img src="/draftrack/draftrackfe/public/ressources/bookmarks/logo_mini.png" />
		    		<span>Bookmarks</span>
			    </a>
			    <?php if(($this->getModule() == 'bookmarks')) echo $this->SidebarLinks(); ?>
		    </li>


	    </ul>
	  
	  </div>  
	  
	  <div id="dt_hideSideBar" <?php if(!$dt_displaySideBar) echo 'class="hidden"' ?> ></div>


	  
	  <div id="dt_content">	
	
	

	
		<?php 
		echo $this->messageDisplay();
		//print_r($this->messageDisplay()->toString()) ?>
	  
	    <?php echo $this->layout()->content ?>
	  
	  </div> <!-- end content -->

  </div> <!-- end mainPanel-->

  <div id="dt_footer">
  </div>
</div>

<?php
//Echo the data to pass to javascript scripts
echo $this->javascriptData();
?>

</body>

<?php
//echo the javascript scripts
echo $this->headScript();

?>

</html>

